home *** CD-ROM | disk | FTP | other *** search
/ Aminet 15 / Aminet 15 - Nov 1996.iso / Aminet / dev / basic / ace24dist.lha / ace24.lha / include / devices / hardblocks.h < prev    next >
C/C++ Source or Header  |  1996-09-10  |  11KB  |  232 lines

  1. #ifndef DEVICES_HARDBLOCKS_H
  2. #define DEVICES_HARDBLOCKS_H 1
  3. /*
  4. ** hardblocks.h for ACE Basic
  5. **
  6. ** Note: Translated to ACE by ConvertC2ACE
  7. **       @ MapMeadow Software, Nils Sjoholm
  8. **
  9. **
  10. ** Date: 09/03/95
  11. **
  12. **
  13. */
  14.  
  15. /*
  16. ** This are the StructPointer defines for hardblocks.h
  17. */
  18. #ifndef BadBlockBlockPtr
  19. #define BadBlockBlockPtr ADDRESS
  20. #endif
  21. #ifndef BadBlockEntryPtr
  22. #define BadBlockEntryPtr ADDRESS
  23. #endif
  24. #ifndef FileSysHeaderBlockPtr
  25. #define FileSysHeaderBlockPtr ADDRESS
  26. #endif
  27. #ifndef LoadSegBlockPtr
  28. #define LoadSegBlockPtr ADDRESS
  29. #endif
  30. #ifndef PartitionBlockPtr
  31. #define PartitionBlockPtr ADDRESS
  32. #endif
  33. #ifndef RigidDiskBlockPtr
  34. #define RigidDiskBlockPtr ADDRESS
  35. #endif
  36. /*
  37. ** End of StructPointer defines for hardblocks.h
  38. */
  39.                    
  40. #ifndef EXEC_TYPES_H
  41. #include <exec/types.h>
  42. #endif /* EXEC_TYPES_H */
  43.  
  44.  
  45. /*--------------------------------------------------------------------
  46.  *
  47.  *  This file describes blocks of data that exist on a hard disk
  48.  *  to describe that disk.  They are not generically accessable to
  49.  *  the user as they do not appear on any DOS drive.  The blocks
  50.  *  are tagged with a unique identifier,  checksummed,  and linked
  51.  *  together.  The root of these blocks is the RigidDiskBlock.
  52.  *
  53.  *  The RigidDiskBlock must exist on the disk within the first
  54.  *  RDB_LOCATION_LIMIT blocks.  This inhibits the use of the zero
  55.  *  cylinder in an AmigaDOS partition: although it is strictly
  56.  *  possible to store the RigidDiskBlock data in the reserved
  57.  *  area of a partition,  this practice is discouraged since the
  58.  *  reserved blocks of a partition are overwritten by "Format", 
  59.  *  "Install",  "DiskCopy",  etc.  The recommended disk layout, 
  60.  *  then,  is to use the first cylinder(s) to store all the drive
  61.  *  data specified by these blocks: i.e. partition descriptions, 
  62.  *  file system load images,  drive bad block maps,  spare blocks, 
  63.  *  etc.
  64.  *
  65.  *  Though only 512 byte blocks are currently supported by the
  66.  *  file system,  this proposal tries to be forward-looking by
  67.  *  making the block size explicit,  and by using only the first
  68.  *  256 bytes for all blocks but the LoadSeg data.
  69.  *
  70.  *------------------------------------------------------------------*/
  71.  
  72. /*
  73.  *  NOTE
  74.  *  optional block addresses below contain $ffffffff to indicate
  75.  *  a NULL address,  as zero is a valid address
  76.  */
  77. STRUCT RigidDiskBlock  
  78.     LONGINT   rdb_ID      /* 4 character identifier */
  79.     LONGINT   rdb_SummedLongs     /* size of this checksummed structure */
  80.     LONGINT    rdb_ChkSum      /* block checksum (longword sum to zero) */
  81.     LONGINT   rdb_HostID      /* SCSI Target ID of host */
  82.     LONGINT   rdb_BlockBytes  /* size of disk blocks */
  83.     LONGINT   rdb_Flags       /* see below for defines */
  84.     /* block list heads */
  85.     LONGINT   rdb_BadBlockList    /* optional bad block list */
  86.     LONGINT   rdb_PartitionList   /* optional first partition block */
  87.     LONGINT   rdb_FileSysHeaderList  /* optional file system header block */
  88.     LONGINT   rdb_DriveInit   /* optional drive-specific init code */
  89.                 /* DriveInit(lun, rdb, ior): "C" stk & d0/a0/a1 */
  90.     STRING rdb_Reserved1 SIZE 24  /* 6*SIZEOF(LONGINT) */   /* set TO $ffffffff */
  91.     /* physical drive characteristics */
  92.     LONGINT   rdb_Cylinders   /* number of drive cylinders */
  93.     LONGINT   rdb_Sectors     /* sectors per track */
  94.     LONGINT   rdb_Heads       /* number of drive heads */
  95.     LONGINT   rdb_Interleave  /* interleave */
  96.     LONGINT   rdb_Park        /* landing zone cylinder */
  97.     STRING rdb_Reserved2 SIZE 12  /* 3*SIZEOF(LONGINT) */
  98.     LONGINT   rdb_WritePreComp    /* starting cylinder: write precompensation */
  99.     LONGINT   rdb_ReducedWrite    /* starting cylinder: reduced write current */
  100.     LONGINT   rdb_StepRate    /* drive step rate */
  101.     STRING rdb_Reserved3 SIZE 20  /* 5*SIZEOF(LONGINT) */
  102.     /* logical drive characteristics */
  103.     LONGINT   rdb_RDBBlocksLo     /* low block of range reserved for hardblocks */
  104.     LONGINT   rdb_RDBBlocksHi     /* high block of range for these hardblocks */
  105.     LONGINT   rdb_LoCylinder  /* low cylinder of partitionable disk area */
  106.     LONGINT   rdb_HiCylinder  /* high cylinder of partitionable data area */
  107.     LONGINT   rdb_CylBlocks   /* number of blocks available per cylinder */
  108.     LONGINT   rdb_AutoParkSeconds  /* zero for no auto park */
  109.     LONGINT   rdb_HighRDSKBlock   /* highest block used by RDSK */
  110.                 /* (not including replacement bad blocks) */
  111.     LONGINT   rdb_Reserved4 
  112.     /* drive identification */
  113.     STRING rdb_DiskVendor SIZE 8  
  114.     STRING rdb_DiskProduct SIZE 16  
  115.     STRING rdb_DiskRevision SIZE 4  
  116.     STRING rdb_ControllerVendor SIZE 8  
  117.     STRING rdb_ControllerProduct SIZE 16  
  118.     STRING rdb_ControllerRevision SIZE 4  
  119.     STRING rdb_Reserved5 SIZE 40  /* 10*SIZEOF(LONGINT) */
  120. END STRUCT 
  121.  
  122. #define IDNAME_RIGIDDISK    &H5244534B  /* 'RDSK' */
  123.  
  124. #define RDB_LOCATION_LIMIT  16
  125.  
  126. #define RDBFB_LAST  0   /* no disks exist to be configured after */
  127. #define RDBFF_LAST  &H01&   /*   this one ON this controller */
  128. #define RDBFB_LASTLUN   1   /* no LUNs exist to be configured greater */
  129. #define RDBFF_LASTLUN   &H02&   /*   than this one at this SCSI Target ID */
  130. #define RDBFB_LASTTID   2   /* no Target IDs exist to be configured */
  131. #define RDBFF_LASTTID   &H04&   /*   greater than this one ON this SCSI bus */
  132. #define RDBFB_NORESELECT 3  /* don't bother trying to perform reselection */
  133. #define RDBFF_NORESELECT &H08&  /*   when talking TO this drive */
  134. #define RDBFB_DISKID    4   /* rdb_Disk... identification valid */
  135. #define RDBFF_DISKID    &H10&
  136. #define RDBFB_CTRLRID   5   /* rdb_Controller... identification valid */
  137. #define RDBFF_CTRLRID   &H20&
  138.                 /* added 7/20/89 by commodore: */
  139. #define RDBFB_SYNCH 6   /* drive supports scsi synchronous mode */
  140. #define RDBFF_SYNCH &H40&   /* CAN BE DANGEROUS TO USE IF IT DOESN'T! */
  141.  
  142. /*------------------------------------------------------------------*/
  143. STRUCT BadBlockEntry  
  144.     LONGINT   bbe_BadBlock    /* block number of bad block */
  145.     LONGINT   bbe_GoodBlock   /* block number of replacement block */
  146. END STRUCT 
  147.  
  148. STRUCT BadBlockBlock  
  149.     LONGINT   bbb_ID      /* 4 character identifier */
  150.     LONGINT   bbb_SummedLongs     /* size of this checksummed structure */
  151.     LONGINT    bbb_ChkSum      /* block checksum (longword sum to zero) */
  152.     LONGINT   bbb_HostID      /* SCSI Target ID of host */
  153.     LONGINT   bbb_Next        /* block number of the next BadBlockBlock */
  154.     LONGINT   bbb_Reserved 
  155.     STRING bbb_BlockPairs SIZE 488  /* 61*8 */  /* bad block entry pairs */
  156.     /* note [61] assumes 512 byte blocks */
  157. END STRUCT 
  158.  
  159. #define IDNAME_BADBLOCK     &H42414442  /* 'BADB' */
  160.  
  161. /*------------------------------------------------------------------*/
  162. STRUCT PartitionBlock  
  163.     LONGINT   pb_ID       /* 4 character identifier */
  164.     LONGINT   pb_SummedLongs  /* size of this checksummed structure */
  165.     LONGINT    pb_ChkSum       /* block checksum (longword sum to zero) */
  166.     LONGINT   pb_HostID       /* SCSI Target ID of host */
  167.     LONGINT   pb_Next         /* block number of the next PartitionBlock */
  168.     LONGINT   pb_Flags        /* see below for defines */
  169.     STRING pb_Reserved1 SIZE 8  /* 2*SIZEOF(LONGINT) */
  170.     LONGINT   pb_DevFlags     /* preferred flags for OpenDevice */
  171.     STRING pb_DriveName SIZE 32     /* preferred DOS device name: ADDRESS form */
  172.                 /* (not used if this name is in use) */
  173.     STRING pb_Reserved2 SIZE 60  /* 15*SIZEOF(LONGINT) */   /* filler TO 32 longwords */
  174.     STRING pb_Environment SIZE 68  /* 17*SIZEOF(LONGINT) */ /* environment vector FOR this partition */
  175.     STRING pb_EReserved SIZE 60  /* 15*SIZEOF(LONGINT) */   /* reserved FOR future environment vector */
  176. END STRUCT 
  177.  
  178. #define IDNAME_PARTITION    &H50415254  /* 'PART' */
  179.  
  180. #define PBFB_BOOTABLE   0   /* this partition is intended to be bootable */
  181. #define PBFF_BOOTABLE   1&  /*   (expected directories AND FILES exist) */
  182. #define PBFB_NOMOUNT    1   /* do not mount this partition (e.g. manually */
  183. #define PBFF_NOMOUNT    2&  /*   mounted,  but space reserved here) */
  184.  
  185. /*------------------------------------------------------------------*/
  186. STRUCT FileSysHeaderBlock  
  187.     LONGINT   fhb_ID      /* 4 character identifier */
  188.     LONGINT   fhb_SummedLongs     /* size of this checksummed structure */
  189.     LONGINT    fhb_ChkSum      /* block checksum (longword sum to zero) */
  190.     LONGINT   fhb_HostID      /* SCSI Target ID of host */
  191.     LONGINT   fhb_Next        /* block number of next FileSysHeaderBlock */
  192.     LONGINT   fhb_Flags       /* see below for defines */
  193.     STRING fhb_Reserved1 SIZE 8  /* 2*SIZEOF(LONGINT) */
  194.     LONGINT   fhb_DosType     /* file system description: match this with */
  195.                 /* partition environment's DE_DOSTYPE entry */
  196.     LONGINT   fhb_Version     /* release version of this code */
  197.     LONGINT   fhb_PatchFlags  /* bits set for those of the following that */
  198.                 /*   need to be substituted into a standard */
  199.                 /*   device node for this file system: e.g. */
  200.                 /*   &H180 to substitute SegList & GlobalVec */
  201.     LONGINT   fhb_Type        /* device node type: zero */
  202.     LONGINT   fhb_Task        /* standard dos "task" field: zero */
  203.     LONGINT   fhb_Lock        /* not used for devices: zero */
  204.     LONGINT   fhb_Handler     /* filename to loadseg: zero placeholder */
  205.     LONGINT   fhb_StackSize   /* stacksize to use when starting task */
  206.     LONGINT    fhb_Priority    /* task priority when starting task */
  207.     LONGINT    fhb_Startup     /* startup msg: zero placeholder */
  208.     LONGINT    fhb_SegListBlocks   /* first of linked list of LoadSegBlocks: */
  209.                 /*   note that this entry requires some */
  210.                 /*   processing before substitution */
  211.     LONGINT    fhb_GlobalVec   /* BCPL global vector when starting task */
  212.     STRING fhb_Reserved2 SIZE 92  /* 23*SIZEOF(LONGINT) */  /* (those reserved by PatchFlags) */
  213.     STRING fhb_Reserved3 SIZE 84  /* 21*SIZEOF(LONGINT) */
  214. END STRUCT 
  215.  
  216. #define IDNAME_FILESYSHEADER    &H46534844  /* 'FSHD' */
  217.  
  218. /*------------------------------------------------------------------*/
  219. STRUCT LoadSegBlock  
  220.     LONGINT   lsb_ID      /* 4 character identifier */
  221.     LONGINT   lsb_SummedLongs     /* size of this checksummed structure */
  222.     LONGINT    lsb_ChkSum      /* block checksum (longword sum to zero) */
  223.     LONGINT   lsb_HostID      /* SCSI Target ID of host */
  224.     LONGINT   lsb_Next        /* block number of the next LoadSegBlock */
  225.     STRING lsb_LoadData SIZE 492  /* 123*SIZEOF(LONGINT) */  /* DATA FOR "loadseg" */
  226.     /* note [123] assumes 512 byte blocks */
  227. END STRUCT 
  228.  
  229. #define IDNAME_LOADSEG      &H4C534547  /* 'LSEG' */
  230.  
  231. #endif  /* DEVICES_HARDBLOCKS_H */
  232.